/*64 MB addresses
#define start_address 0x00000000			//starting address to write the Boot/BPB sector
#define FAT1_entries_start 0x00001000		//starting address of FAT1 
#define FAT2_entries_start 0x0001F800		//starting address of FAT2
#define root_directory_addr 0x0003E000		//starting address of root directory
#define data_region_addr 0x00042000			//starting address of data region (first sector will be reserved for patient's information)
#define last_addr 0x3BD7E00				//exact for 512mb (capacity of 501,735,424bytes or 478 MB in the properties)
*/

/*256 MB addresses
#define start_address 0x00000000			//starting address to write the Boot/BPB sector
#define FAT1_entries_start 0x00000C00		//starting address of FAT1 
#define FAT2_entries_start 0x0001F600		//starting address of FAT2
#define root_directory_addr 0x0003E000		//starting address of root directory
#define data_region_addr 0x00042000			//starting address of data region (first sector will be reserved for patient's information)
#define last_addr 0x0F1FFFFF				//last address or 0x0F1FFFF0
*/

/*512 MB addresses
#define start_address 0x00000000			//starting address to write the Boot/BPB sector
#define FAT1_entries_start 0x00001000		//starting address of FAT1 
#define FAT2_entries_start 0x0001F000		//starting address of FAT2
#define root_directory_addr 0x0003D000		//starting address of root directory
#define data_region_addr 0x00041000			//starting address of data region (first sector will be reserved for patient's information)
#define last_addr 0x1DEBF000				//exact for 512mb (capacity of 501,735,424bytes or 478 MB in the properties)
*/

/*//1 GB addresses
#define start_address 0x00000000			//starting address to write the Boot/BPB sector
#define FAT1_entries_start 0x00000C00		//starting address of FAT1 
#define FAT2_entries_start 0x0001F600		//starting address of FAT2
#define root_directory_addr 0x0003E000		//starting address of root directory
#define data_region_addr 0x00042000			//starting address of data region
#define last_addr 0x3D3BC000				//exact for 1gb (capacity of 1,027,325,952 bytes or 979 MB in the properties)
*/
//2 GB addresses
#define start_address 0x00000000			//starting address to write the Boot/BPB sector
#define FAT1_entries_start 0x00000400		//starting address of FAT1 
#define FAT2_entries_start 0x0001DA00		//starting address of FAT2
#define root_directory_addr 0x0003B000		//starting address of root directory
#define data_region_addr 0x0003F000			//starting address of data region
#define last_addr 0x753C0000				//exact for 2GB (capacity of 1,966,866,432bytes or 1.83GB in the properties)

void format_to_fat16 (void);
unsigned char findlastfolder(void);
unsigned char create_folder_file(char*, char, char);
char writetommc(char *,char *);
void DATAfull(void);
void check_updateFAT(void);
void updateCSVsize(void);
